/*
 * @Description: 意见、附言相关
 */
export default ({ service, request, tools }) => ({
  /**
   * @description: 获取意见列表
   */
  findSummaryComments(data) {
    return request({
      url: '/rest/collPC/findSummaryComments',
      headers: { 'content-type': 'application/json' },
      method: 'post',
      baseURL: '/seeyon',
      data
    });
  },
  /**
   * @description: 获取意见列表
   */
  commentGetList(params) {
    return request({
      url: '/new/comments',
      params
    });
  },
  /**
   * @description: 获取at列表
   */
  commentGetAtList(summaryId) {
    return request({
      url: `/new/comments/atwho/${summaryId}`
    });
  },
  /**
   * @description: 提交意见
   */
  commentCommitComment(data) {
    return request({
      url: '/new/comments',
      headers: { 'content-type': 'application/json' },
      method: 'post',
      data
    });
  },
  /**
   * @description: 点赞与取消点赞
   * @param {String}}commentId 评论id
   * @param {Boolean}isCancel 是否是取消点赞
   */
  commentPraise(commentId, isCancel) {
    return request({
      url: `/comments/praise/${isCancel ? 'cancel' : 'add'}/${commentId}`,
      method: 'post'
    });
  }
});
